package com.yuandian.api.management.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yuandian.api.management.validate.InsertFlag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 单位配置表-实体
 * @author zfsn
 * @date 2023-6-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "单位配置表", description = "")
@TableName("conf_unit")
public class ConfUnit extends BasePage<ConfUnit> {

    /**
     * 唯一标识数据
     */
    @ApiModelProperty(value = "主键", notes = "唯一标识数据")
    @TableId(type = IdType.AUTO)
    private Integer id;

	@ApiModelProperty(value = "单位标识", notes = "单位标识")
    private String code;

    /**
     * 
     */
    @ApiModelProperty(value = "所属系统id", notes = "")
    private Integer systemId;

	/**
	 *
	 */
	@NotNull(message = "所属系统id为空", groups = InsertFlag.class)
	@ApiModelProperty(value = "所属系统ids", notes = "")
	private List<Integer> systemIds;

	/**
	 *
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "系统名称", notes = "")
	private String systemName;

    /**
     * 
     */
    @NotNull(message = "单位名称不能为空", groups = InsertFlag.class)
    @ApiModelProperty(value = "单位名称", notes = "")
    private String name;

    /**
     * 对应sys_user的user_id
     */
    @JsonIgnore
    @ApiModelProperty(value = "用户id", notes = "对应sys_user的user_id")
    private String userId;

    /**
     * 
     */
    @ApiModelProperty(value = "创建人", notes = "")
    private String createBy;

    /**
     * 
     */
    @ApiModelProperty(value = "创建时间", notes = "")
    private LocalDateTime createTime;

    /**
     * 
     */
    @ApiModelProperty(value = "更新人", notes = "")
    private String updateBy;

    /**
     * 
     */
    @ApiModelProperty(value = "更新时间", notes = "")
    private LocalDateTime updateTime;

    /**
     * 0：否、1：是
     */
    @ApiModelProperty(value = "是否逻辑删除", notes = "0：否、1：是")
    private Integer isDel;

    /**
     * 
     */
    @ApiModelProperty(value = "备注", notes = "")
    private String remarks;

	/**
	 *
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "用户名称", notes = "")
	private String userName;


	@TableField(exist = false)
	@NotNull(message = "关联用户不能为空", groups = InsertFlag.class)
	@ApiModelProperty(value = "用户id", notes = "")
	private List<Long> userIds;

}